<?php

namespace app\index\Validate;
use think\Validate;
class System extends Validate {
    protected $rule =   [
        'id'  => 'require|number',
        'system_name'   => 'require',
        'system' => 'unique:system',
    ];

    protected $message  =   [
        'id.require' => '名称必须',
        'id.number' => '名称必须数字',
        'system_name.require'     => '名称不能为空',
        'system.number'   => '年龄必须是数字',
        'age.unique'  => '标志应该唯一',
    ];

    protected $scene = [
        'add'  =>  ['system_name','system'],
        'edit'  =>  ['id'],
    ];
}

?>
